@import '../../styles/themes/default.less';

.@{rk-prefix} {
  &-overflow-hidden {
    overflow: hidden !important;
  }

  &-popup {
    position: fixed;
    max-height: 100%;
    overflow-y: auto;
    background-color: @popup-background-color;
    -webkit-overflow-scrolling: touch;

    &--center {
      top: 50%;
      left: 50%;
      transform: translate3d(-50%, -50%, 0);

      &.rk-popup--round {
        border-radius: @popup-round-border-radius;
      }
    }

    &--top {
      top: 0;
      left: 0;
      width: 100%;

      &.rk-popup--round {
        border-radius: 0 0 @popup-round-border-radius @popup-round-border-radius;
      }
    }

    &--right {
      top: 0;
      right: 0;

      &.rk-popup--round {
        border-radius: @popup-round-border-radius 0 0 @popup-round-border-radius;
      }
    }

    &--bottom {
      bottom: 0;
      left: 0;
      width: 100%;

      &.rk-popup--round {
        border-radius: @popup-round-border-radius @popup-round-border-radius 0 0;
      }
    }

    &--left {
      top: 0;
      left: 0;

      &.rk-popup--round {
        border-radius: 0 @popup-round-border-radius @popup-round-border-radius 0;
      }
    }

    &--safe-area-inset-bottom {
      padding-bottom: constant(safe-area-inset-bottom);
      padding-bottom: env(safe-area-inset-bottom);
    }

    &-slide-top-enter,
    &-slide-top-exit-active {
      transform: translate3d(0, -100%, 0);
    }

    &-slide-right-enter,
    &-slide-right-exit-active {
      transform: translate3d(100%, 0, 0);
    }

    &-slide-bottom-enter,
    &-slide-bottom-exit-active {
      transform: translate3d(0, 100%, 0);
    }

    &-slide-left-enter,
    &-slide-left-exit-active {
      transform: translate3d(-100%, 0, 0);
    }

    &-slide-top-enter-active,
    &-slide-left-enter-active,
    &-slide-right-enter-active,
    &-slide-bottom-enter-active {
      transform: translate3d(0, 0, 0);
      transition: @popup-transition;
    }

    &-slide-top-exit-active,
    &-slide-left-exit-active,
    &-slide-right-exit-active,
    &-slide-bottom-exit-active {
      transition: @popup-transition;
      transition-timing-function: @animation-timing-function-leave;
    }

    &__close-icon {
      position: absolute;
      z-index: @popup-close-icon-z-index;
      color: @popup-close-icon-color;
      font-size: @popup-close-icon-size;
      cursor: pointer;

      &:active {
        color: @popup-close-icon-active-color;
      }

      &--top-left {
        top: @popup-close-icon-margin;
        left: @popup-close-icon-margin;
      }

      &--top-right {
        top: @popup-close-icon-margin;
        right: @popup-close-icon-margin;
      }

      &--bottom-left {
        bottom: @popup-close-icon-margin;
        left: @popup-close-icon-margin;
      }

      &--bottom-right {
        right: @popup-close-icon-margin;
        bottom: @popup-close-icon-margin;
      }
    }

    &__title {
      margin: 20px 50px 12px 20px;
      font-weight: 500;
      font-size: @popup-title-font-size;
      line-height: @popup-title-font-size;
    }

    &__descrition {
      margin: 0 20px;
      color: #999;
      font-size: @popup-descrition-font-size;
    }
  }
}
